#include <iostream>
#include <cstdio>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>


const std::string myenv = "HELLO=AAAAAAAAAAAAAAA";

int main()
{
	putenv((char*)myenv.c_str());
	pid_t id = fork();
	if(id == 0)
	{
		char* const argv[]={
			(char*)"other",
			nullptr
		};
		char* const env[]={
			(char*)"HELLO=ltw"
		};
		execl("./other","other",nullptr);
		exit(1);
	}
	
	pid_t rid = waitpid(id,nullptr,0);
	if(rid > 0)
	{
		printf("等待子进程成功!\n");
	}

	return 0;
}



